package cn.edu.cug.cs.gtl.renders.openinventor.viewers;

import cn.edu.cug.cs.gtl.apis.render.nodes.Camera;
import com.openinventor.inventor.nodes.SoCamera;
import com.openinventor.inventor.viewercomponents.SoCameraInteractor;

public class CameraInteractorImpl implements cn.edu.cug.cs.gtl.apis.render.viewers.CameraInteractor{
    protected SoCameraInteractor nativeObject = null;
    public CameraInteractorImpl(Camera c) {
        this.nativeObject = new SoCameraInteractor((SoCamera) c.getNativeObject());
    }

    public CameraInteractorImpl(SoCamera c) {
        this.nativeObject = new SoCameraInteractor(c);
    }
    @Override
    public Object getNativeObject() {
        return nativeObject;
    }

    @Override
    public boolean attach(Object nativeObject) {
        this.nativeObject = (SoCameraInteractor)nativeObject;
        return true;
    }

    @Override
    public Object detach() {
        SoCameraInteractor s = this.nativeObject;
        this.nativeObject = null;
        return s;
    }
}
